package com.ldy.demo5;

import org.junit.Test;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;

/**
 * 描述：<br>
 * 版权：Copyright (c) 2011 ~ 2017<br>
 * 公司：北京活力天汇<br>
 * 作者：刘德咏<br>
 * 版本：1.0<br>
 * 创建日期：2017/7/18<br>
 */
public class URLDemo {
    @Test
    public void test() throws UnsupportedEncodingException {
        String str = "%5b%7b%22code%22%3a%22WUH%22%2c%22airport%22%3a%22%e6%ad%a6%e6%b1%89%e5%a4%a9%e6%b2%b3%e5%9b%bd%e9%99%85%e6%9c%ba%e5%9c%ba%22%2c%22city%22%3a%22%e6%ad%a6%e6%b1%89%22%2c%22country%22%3a%22%e4%b8%ad%e5%9b%bd%22%2c%22cityNCountry%22%3a%22%e6%ad%a6%e6%b1%89%2c+%e4%b8%ad%e5%9b%bd%22%7d%2c%7b%22code%22%3a%22HKG%22%2c%22airport%22%3a%22%e9%a6%99%e6%b8%af%e5%9b%bd%e9%99%85%e6%9c%ba%e5%9c%ba%22%2c%22city%22%3a%22%e9%a6%99%e6%b8%af%22%2c%22country%22%3a%22%e9%a6%99%e6%b8%af%22%2c%22cityNCountry%22%3a%22%e9%a6%99%e6%b8%af%22%7d%2c%7b%22code%22%3a%22BKK%22%2c%22airport%22%3a%22%e8%8b%8f%e7%93%a6%e9%82%a3%e5%b8%83%e5%91%bc%e7%b1%b3%e5%9b%bd%e9%99%85%e6%9c%ba%e5%9c%ba%22%2c%22city%22%3a%22%e6%9b%bc%e8%b0%b7%22%2c%22country%22%3a%22%e6%b3%b0%e5%9b%bd%22%2c%22cityNCountry%22%3a%22%e6%9b%bc%e8%b0%b7%2c+%e6%b3%b0%e5%9b%bd%22%7d%5d";
        String decode = URLDecoder.decode(str, "utf-8");
        System.out.println(decode);
    }

    public static void main(String[] args) {
    }
}
